/**
 * 
 */
package fr.cephb.io;

import java.io.IOException;
import java.io.OutputStream;

/**
 * A class defined for making test. It write nothings but count the number of
 * bytes written.
 *
 */
public class NullOutputStream extends OutputStream
	{
	private long count=0L;
	
	@Override
	public void write(int b) throws IOException {
		count++;
		}
	
	@Override
	public void write(byte[] b) throws IOException {
		count+=b.length;
		}
	
	@Override
	public void write(byte[] b, int off, int len) throws IOException {
		count+=len;
		}
	
	/** return the number of bytes written */
	public long getCount()
		{
		return count;
		}
	}
